this._grid.currentPage = 0;
this._stack.add_actor(this._grid);
- this._eventBlocker = new St.Widget({ x_expand: true, y_expand: true });
+ this._eventBlocker = new St.Widget({
+ x_expand: true,
+ y_expand: true,
+ reactive: true,
+ visible: false,
+ });
this._stack.add_actor(this._eventBlocker);
box.add_actor(this._stack);
});
this._eventBlocker.add_action(this._clickAction);
+ this._currentPopup = null;
this._displayingPopup = false;
this._currentPopupDestroyId = 0;
Main.overview.connect('item-drag-begin', this._onDragBegin.bind(this));
Main.overview.connect('item-drag-end', this._onDragEnd.bind(this));
-
- this._nEventBlockerInhibits = 0;
}
vfunc_map() {
openSpaceForPopup(item, side, nRows) {
this._updateIconOpacities(true);
this._displayingPopup = true;
- this._eventBlocker.reactive = true;
this._grid.openExtraSpace(item, side, nRows);
}
addFolderPopup(popup) {
this._stack.add_actor(popup);
popup.connect('open-state-changed', (o, isOpen) => {
- this._eventBlocker.reactive = isOpen;
+ this._eventBlocker.visible = isOpen;
if (this._currentPopup) {
this._currentPopup.disconnect(this._currentPopupDestroyId);
this._currentPopupDestroyId = popup.connect('destroy', () => {
this._currentPopup = null;
this._currentPopupDestroyId = 0;
- this._eventBlocker.reactive = false;
+ this._eventBlocker.visible = false;
});
}
this._updateIconOpacities(isOpen);
dragMotion: this._onDragMotion.bind(this),
};
DND.addDragMonitor(this._dragMonitor);
+
+ this._eventBlocker.visible = false;
}
_onDragMotion(dragEvent) {
DND.removeDragMonitor(this._dragMonitor);
this._dragMonitor = null;
}
+
+ this._eventBlocker.visible = this._currentPopup !== null;
}
_canAccept(source) {
return true;
}
- inhibitEventBlocker() {
- this._nEventBlockerInhibits++;
- this._eventBlocker.visible = this._nEventBlockerInhibits == 0;
- }
-
- uninhibitEventBlocker() {
- if (this._nEventBlockerInhibits === 0)
- throw new Error('Not inhibited');
-
- this._nEventBlockerInhibits--;
- this._eventBlocker.visible = this._nEventBlockerInhibits == 0;
- }
-
createFolder(apps) {
let newFolderId = GLib.uuid_string_random();
dragMotion: this._onDragMotion.bind(this),
};
DND.addDragMonitor(this._dragMonitor);
-
- this._parentView.inhibitEventBlocker();
}
_onDragMotion(dragEvent) {
_onDragEnd() {
this.remove_style_pseudo_class('drop');
- this._parentView.uninhibitEventBlocker();
DND.removeDragMonitor(this._dragMonitor);
}